package logic

import (
	"context"
	"course_srv/models/es"

	"course_srv/course"
	"course_srv/internal/svc"

	"github.com/zeromicro/go-zero/core/logx"
)

type EsListLogic struct {
	ctx    context.Context
	svcCtx *svc.ServiceContext
	logx.Logger
}

func NewEsListLogic(ctx context.Context, svcCtx *svc.ServiceContext) *EsListLogic {
	return &EsListLogic{
		ctx:    ctx,
		svcCtx: svcCtx,
		Logger: logx.WithContext(ctx),
	}
}

func (l *EsListLogic) EsList(in *course.EsListRequest) (*course.EsListResponse, error) {
	list := es.EsList(in.KeyWord)
	return &course.EsListResponse{List: list}, nil
}
